<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class TRealdataThree extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_realdata_three', function (Blueprint $table) {
             $table->engine = 'MEMORY';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->datetime('rd_updatetime')->nullable(false)->comment('');
			$table->unsignedInteger('pdi_index')->nullable(false)->default(0)->comment('');
			$table->string('rd_upsmanuinfo', 25)->nullable()->default('')->comment('');
			$table->string('rd_upsmactype', 25)->nullable()->default('')->comment('');
			$table->string('rd_upsver', 25)->nullable()->default('')->comment('');
			$table->string('rd_upsvolr', 25)->nullable()->default('')->comment('');
			$table->string('rd_upscurr', 25)->nullable()->default('')->comment('');
			$table->string('rd_upsbatvolr', 25)->nullable()->default('')->comment('');
			$table->string('rd_upsfreqr', 25)->nullable()->default('')->comment('');
			$table->float('rd_UPSShutType', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_ShutType', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatEnvi', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatStatus', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatChargeStatus', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatLastTime', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatDisTime', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_GageCharge', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatCur', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatTemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InBadNum', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InNum', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InFreq1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InVol1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InCur1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InPower1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InFreq2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InVol2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InCur2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InPower2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InFreq3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InVol3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InCur3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_InPower3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutHead', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutFreq', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutNum', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutVol1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutCur1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutPower1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutLoad1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutVol2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutCur2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutPower2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutLoad2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutVol3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutCur3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutPower3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutLoad3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassFreq', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassNum', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassVol1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassCur1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassPower1', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassVol2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassCur2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassPower2', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassVol3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassCur3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_PassPower3', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_UPSTestResult', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_OutAllLoad', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_BatCapacity', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_MachTemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('rd_FaultID', 9, 2)->nullable()->default(0)->comment('');
			$table->boolean('rd_TempOverWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_InFailWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_OutFailWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_OverLoadWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_PassFailWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_OutCloseWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_UPSShutWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_ChargeFailWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_SystemShutWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_FanFailWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_FusiWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_GenericFailWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_AwaitingPowerWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_ShutLastWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_ShutNowWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_DevDisWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_BatFalutWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_BatVolLowWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_BypassWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_OtherFaultWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_TestWarn')->nullable()->default(0)->comment('');
			$table->boolean('rd_NetCom')->nullable()->default(0)->comment('');
			$table->unique('pdi_index', 'pdi_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_realdata_three');
    }
}
